/**
 * 
 */
package javapop.framework.generic;

import java.util.ArrayList;
import java.util.List;

import javapop.framework.generic.tool.GrammarVisitor;

/**
 * @author hakim
 *
 */
public class GTuple implements GParser {

	private List<GParser> list;
	
	/**
	 * @param content 
	 * 
	 */
	public GTuple(List<GParser> content) {
		list = new ArrayList<GParser>();
		list.add(new GIgnore(new GRefParser("skip")));
		for (GParser gParser : content) {
			list.add(gParser);
			list.add(new GIgnore(new GRefParser("skip")));
		}
	}

	@Override
	public <T,R,E extends Exception> T visit(GrammarVisitor<T,R, E> g) throws E {
		return g.visit(this);
	}

	public List<GParser> getList() {
		return list;
	}

}
